import { Navigate } from 'react-router-dom'
import { lazy } from 'react'

//新增用户页面
import AddUser from '../views/main/addUser'
//编辑用户页面
import EditUser from '../views/main/editUser'
//案件查询
import QueryCase from '../views/main/queryCase'
//案件状态
import CaseStatus from '../views/main/caseStatus'
//推送情况
import PushState from '../views/main/pushState'


//登录页面
const Login = lazy(() => import('../views/login'))

//主页面
const Main = lazy(() => import('../views/main'))



const element = [
	{
		path: 'login',
		element: <Login />
	},
	{
		path: 'main',
		element: <Main />,
		children: [
			{
				path: 'addUser',
				element: <AddUser />,
			},
			{
				path: 'editUser',
				element: <EditUser />,
			},
			{
				path: 'queryCase',
				element: <QueryCase />,
			},
			{
				path: 'caseStatus',
				element: <CaseStatus />,
			},
			{
				path: 'pushState',
				element: <PushState />,
			}
		]
	},
	//严格模式，去掉缺省
	{
		path: '/',
		element: <Navigate to='login' />
	}
]


export default element;
